import greenfoot.*;  // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)

/**
 * MyCat is your own cat. Get it to do things by writing code in its act method.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class MyCat extends Cat
{
    private boolean flag=true;
    /**
     * Act - do whatever the MyCat wants to do.
     */
    public void act()
    {
           if( isAtEdge() )
           {
            flag=!flag;
        }    
        if(flag==true)
        {
            walkRight(1);
        }
        else
        {
            walkLeft(1);
        }
    }    
}
